<template>
	<div>
		<jk-table border :stripe="false" :height="height" :data="machineList || []">
			<vxe-column title="机台" align="left" field="machineName" :width="90"></vxe-column>
			<vxe-column title="状态" align="center" field="machineName" :width="90">
				<template slot-scope="scope">
					<jk-state-bar :state="scope.row.openingState" :state-list="openStateList"></jk-state-bar>
				</template>
			</vxe-column>
			<vxe-column title="计划开台日期" align="left" field="subPlanStartDate" :width="140"></vxe-column>
			<vxe-column title="实际开台时间" align="left" field="startSystemTime" :width="150"></vxe-column>
			<vxe-column title="实际了机时间" align="left" field="endSystemTime" :width="150"></vxe-column>
		</jk-table>
		<detail-dialog
			:machine-item="selectMachineItem"
			:dialog-state="detailDialogState"
			@on-visible-change="onVisibleChangeOfDetailDialog"
		></detail-dialog>
		<process-item-detail-dialog
			:process-item="selectProcessItem"
			:dialog-state="processItemDetailDialogState"
			@on-visible-change="onVisibleChangeOfProcessItemDetailDialog"
		></process-item-detail-dialog>
	</div>
</template>

<script>
    import calHeight from '/src/mixins/cal-dialog-height';
    import { openStateList } from '../../../../../utils/jk/status-option-list';
    import machineInfoPopover from '../machine-info-popover';
    import processInfoPopover from '../process-info-popover';
    import detailDialog from '../machine-item-detail-dialog';
    import processItemDetailDialog from '../process-item-detail-dialog';
    export default {
        props: {
            height: {
                type: Number,
                default: 0
            },
            machineList: {
                type: Array,
                default() {
                    return [];
                }
            }
        },
        mixins: [calHeight],
        components: {
            processItemDetailDialog,
            detailDialog,
            machineInfoPopover,
            processInfoPopover
        },
        data() {
            return {
                processItemDetailDialogState: false,
                selectProcessItem: {},
                detailDialogState: false,
                selectMachineItem: {},
                openStateList: openStateList,
                ruleForm: {}
            };
        },
        methods: {
            onSelectProcessItem(e) {
                this.selectProcessItem = e;
                this.processItemDetailDialogState = true;
            },
            onVisibleChangeOfProcessItemDetailDialog(e) {
                this.processItemDetailDialogState = e;
            },
            onSelectMachineItem(e) {
                this.selectMachineItem = e;
                this.detailDialogState = true;
            },
            onVisibleChangeOfDetailDialog(e) {
                this.detailDialogState = e;
            },
            getData() {
                this.ruleForm = JSON.parse(JSON.stringify(this.formData));
            }
        },
        mounted() {
        },
        watch: {
            formData: {
                handler() {
                },
                deep: true
            }
        }
    };
</script>
